import {createApp} from 'vue';
import App from './App.vue';
import router from './router/index';
import store from './vuex/index';
import axios from 'axios';
import VueAxios from 'vue-axios';
import VueSocketIO from 'vue-socket.io';
import {registerSockets, destroySockets} from "./socket";
import 'element-plus/dist/index.css';

const socket = new VueSocketIO({
    debug: true,
    connection: 'wss://cblchess.saelinzi.com',
    options: {
        autoConnect: false,//关闭自动连接
    }
});
const app = createApp(App);
app.use(router);
app.use(store);
app.use(VueAxios, axios);
app.config.globalProperties.$socket = socket;
app.config.globalProperties.$addSockets = registerSockets;
app.config.globalProperties.$removeSockets = destroySockets;
app.mount('#app');

export default app;
